﻿<%@ page title="" language="C#" masterpagefile="~/AdminMasterPage.master" enableeventvalidation="false" autoeventwireup="true" inherits="PL_Branches, App_Web_1zw2ahqk" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .auto-style6
        {
        }

        .auto-style8
        {
            height: 24px;
        }

        .auto-style9
        {
            height: 335px;
        }

        .auto-style10
        {
            height: 29px;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <table class="auto-style1">
        <tr>
            <td class="auto-style9">
                <asp:Label ID="ViewBranchesLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Blue" Text="View Branches"></asp:Label>
                <br />
                <br />

                <asp:GridView ID="BranchGV" runat="server" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="5" AutoGenerateColumns="False" BackColor="#CCCCCC" BorderColor="#999999" BorderStyle="Solid" BorderWidth="3px" CellPadding="4" CellSpacing="2" ForeColor="Black" OnRowDataBound="BranchGV_RowDataBound" OnRowEditing="BranchGV_RowEditing" OnRowCommand="BranchGV_RowCommand">
                    <Columns>

                        <asp:TemplateField SortExpression="Branch Id" HeaderText="Branch Id">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="BranchIdLbl" Text='<%# Eval("BranchId") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:TextBox ID="BranchIdTxtBx" Text='<%# Eval("BranchId") %>' Visible="false" ForeColor="#990033" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>


                        <asp:TemplateField SortExpression="Branch Name" HeaderText="Branch Name ">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="BranchNameLbl" Text='<%# Eval("BranchName") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:TextBox ID="BranchNameTxtBx" Text='<%# Eval("BranchName") %>' Visible="false" ForeColor="#990033" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField SortExpression="Branch Created Date" HeaderText="Branch Created Date">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>
                                <asp:Label ID="BranchCrtdLbl" Text='<%# Eval("BrnchCrtdDt", "{0:d}") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:TextBox ID="BranchCrtdTxtBx" Text='<%# Eval("BrnchCrtdDt", "{0:d}") %>' Visible="false" ForeColor="#990033" runat="server" />

                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField SortExpression="Address" HeaderText="Address">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />
                            <ItemTemplate>

                                <asp:Label ID="AddressLbl" Text='<%# Eval("Address") %>' Visible="true" ForeColor="#990033" runat="server" />
                                <asp:DropDownList ID="AddressDrpDwn" DataTextField="Address" DataValueField="AddressId" AppendDataBoundItems="True"
                                    AutoPostBack="True" Visible="false" ForeColor="#990033" runat="server"  />


                            </ItemTemplate>
                        </asp:TemplateField>

                     
                        <asp:TemplateField HeaderText="Update ">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                            <ItemTemplate>
                                <asp:Button ID="UpdateBtn" runat="server" CommandName="update" Text="Update" OnClick="UpdateBtn_Click"></asp:Button>
                            </ItemTemplate>

                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Delete ">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                            <ItemTemplate>
                                <asp:Button ID="DeleteBtn" runat="server" CommandName="update" Text="Delete" OnClick="DeleteBtn_Click"></asp:Button>
                            </ItemTemplate>

                        </asp:TemplateField>

                           <asp:TemplateField HeaderText="Edit " Visible="false">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                            <ItemTemplate>
                                <asp:Button ID="EditBtn" runat="server" CommandName="edit" OnClick="EditBtn_Click" Text="Edit"></asp:Button>
                            </ItemTemplate>

                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Select " Visible="false">
                            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" />

                            <ItemTemplate>
                                <asp:Button ID="SelectBtn" runat="server" CommandName="Select" OnClick="EditBtn_Click" Text="Edit"></asp:Button>
                            </ItemTemplate>

                        </asp:TemplateField>

                    </Columns>
                    <FooterStyle BackColor="#CCCCCC" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                    <RowStyle BackColor="White" />
                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                    <SortedAscendingHeaderStyle BackColor="#808080" />
                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                    <SortedDescendingHeaderStyle BackColor="#383838" />
                </asp:GridView>

                <script type="text/javascript">

                    function callButtonClickEvent() {
                        document.getElementById("Edit".ClientID).click();

                    }
                </script>


            </td>
        </tr>
        <tr>
            <td class="auto-style10">

                <asp:Label ID="Note" runat="server" Font-Bold="True" Font-Size="Medium" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="auto-style10">

                <asp:Label ID="UpdateDElete" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red"></asp:Label>
            </td>
        </tr>
        <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="#990033" Text="View Branches"></asp:Label>
    </table>
    <table class="auto-style1">
        <tr>
            <td colspan="2" class="auto-style8">
                <asp:Label ID="BranchLbl" runat="server" Font-Bold="True" Font-Size="Larger" Text="Branches" ForeColor="Blue"></asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td align="left" class="auto-style6">
                <asp:Label ID="BranchNameLbl" runat="server" Text="Branch Name" Font-Bold="True" ForeColor="#990033"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="BranchNameTxtBx" runat="server"></asp:TextBox>
            </td>
            <td>

                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                      ControlToValidate="BranchNameTxtBx" ErrorMessage="Branch Name field should not be empty"
                    ValidationGroup="b" Font-Bold="True" ForeColor="Red">*</asp:RequiredFieldValidator>

            </td>
        </tr>
        <tr>
            <td align="left" colspan="2" class="auto-style4"></td>
        </tr>
        <tr>
            <td align="left" class="auto-style6">
                <asp:Label ID="AddressIdLbl" runat="server" Text="Address " Font-Bold="True" ForeColor="#990033"></asp:Label>
            </td>
            <td align="left">
                <asp:DropDownList ID="AddressIdDropDown" runat="server" AutoPostBack="True" DataTextField="Address" DataValueField="AddressId" Height="16px" OnSelectedIndexChanged="AddressIdDropDown_SelectedIndexChanged" Width="125px" CausesValidation="True">
                </asp:DropDownList>

            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style6" align="left">
                <asp:Label ID="BrnchCrtdDtLbl" runat="server" Text="Branch Created Date" Font-Bold="True" ForeColor="#990033"></asp:Label>
            </td>
            <td align="left">
                <asp:TextBox ID="BranchCrtdDtTxtBx" runat="server" ReadOnly="True"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style6" colspan="2">
                <asp:Button ID="AddBtn" runat="server" OnClick="AddBtn_Click" ValidationGroup="b" Text="Add" />
            </td>
        </tr>
        <tr>
            <td colspan="2">&nbsp;</td>
        </tr>
        <tr>
            <td colspan="2">
                <script type="text/javascript">

                    function HideLabel() {
                        document.getElementById('<%= DsplyLbl.ClientID %>').style.display = "none";
                        document.getElementById('<%= UpdateDElete.ClientID %>').style.display = "none";
                    }
                    setTimeout("HideLabel();", 3000);
                </script>
                
                <asp:Label ID="DsplyLbl" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red"></asp:Label>
            </td>

        </tr>
        <tr>
            <td>

                <asp:ValidationSummary ID="ValidationSummary1" runat="server"
                    Font-Bold="True" ForeColor="Red" Height="39px" Width="318px" ValidationGroup="b" />
            </td>
        </tr>
    </table>
</asp:Content>
